package edu.yngsxy.wkstudy.core.sys.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import edu.yngsxy.wkstudy.core.model.entity.WkBaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import jakarta.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
/**
 * <p>
 * 角色与权限的多对多关联表
 * </p>
 *
 * @author group 2
 * @since 2025-09-09
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
@TableName("rolepermission")
@Schema(description = "角色与权限的多对多关联表")
public class Rolepermission extends WkBaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 角色ID（外键，关联Role）
     */
    @TableField("role_id")
    @Schema(title = "角色ID（外键，关联Role）", description = "角色ID（外键，关联Role）", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotNull(message = "角色ID（外键，关联Role）不能为空")
    private Integer roleId;

    /**
     * 权限ID（外键，关联Permission）
     */
    @TableField("permission_id")
    @Schema(title = "权限ID（外键，关联Permission）", description = "权限ID（外键，关联Permission）", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotNull(message = "权限ID（外键，关联Permission）不能为空")
    private Integer permissionId;
}
